package com.lt.utils;

import org.joda.time.DateTime
        ;

/**
 * @Author :liteng
 * @Time : 2023-10-22 16:06
 */


public class TencentCOSUtils {


    /**
     * 根据原始文件名生成oss文件名
     *
     * @param originalFileName
     * @return
     */
    public static String getFileKey(String originalFileName) {
        String filePath = "";
//        //1.获取后缀名 2.去除文件后缀 替换所有特殊字符
//        originalfileName.lastIndexOf("\\")
//        String fileType = originalfileName.substring(originalfileName.lastIndexOf("."));
//        String fileStr = StrUtil.removeSuffix(originalfileName, fileType).replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5]", "_");
        filePath += new DateTime().toString("yyyy-MM-dd_HH:mm:ss") + "_" + originalFileName;
        return filePath;
    }


}
